{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">品牌名字：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_name" value="{$info.pp_name}" lay-verify="required" placeholder="品牌名字" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">缩略图：</label>
                            <input type="hidden" name="pp_thumb" id="lay-img" lay-verify="image" value="{$info.pp_thumb}">
                            <div class="layui-input-block">
                                <div id="lay-upload">上传图片</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览图：
                                    <div class="layui-upload-list" id="lay-list">
                                        <img class="layui-append-img" src="{$info.pp_thumb}" onerror="this.src='/static/admin/images/no_img.jpg'">
                                    </div>
                                </blockquote>
                            </div>
                        </div>
                        {if $agid != 10}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">选择分类：</label>
                            <div class="layui-input-block">
                                <select name="pp_t_id"  lay-search="">
                                    {foreach name="types" item="v"}
                                    <option value="{$v.t_id}" {if $v.t_id==$info.pp_t_id}selected{/if}>{$v.t_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        {/if}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">普通用户优惠：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_coupon1" value="{$info.pp_coupon1}" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">高级用户优惠：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_coupon2" value="{$info.pp_coupon2}" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">贵宾用户优惠：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_coupon3" value="{$info.pp_coupon3}" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">vip用户优惠：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_coupon4" value="{$info.pp_coupon4}" class="layui-input ">
                            </div>
                        </div>

                        <!--<div class="layui-form-item layui-col-md-offset1 layui-col-md8">-->
                            <!--<label class="layui-form-label">星级显示：</label>-->
                            <!--<div class="layui-input-block">-->
                                <!--<input type="radio" name="pp_star" value="1" title="显示" {if $info.pp_star == 1}checked{/if}>-->
                                <!--<input type="radio" name="pp_star" value="2" title="不显示" {if $info.pp_star == 2}checked{/if}>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">品牌广告：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_slogan" value="{$info.pp_slogan}" placeholder="品牌广告" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">设计师佣金：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_yongjin1" value="{$info.pp_yongjin1}" placeholder="设计师佣金文案" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">合作业务佣金：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_yongjin2" value="{$info.pp_yongjin2}" placeholder="合作业务佣金文案" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">公司业务佣金：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_yongjin3" value="{$info.pp_yongjin3}" placeholder="公司业务佣金文案" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">公司管理层佣金：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_yongjin4" value="{$info.pp_yongjin4}" placeholder="公司管理层佣金文案" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8" id="image_1">
                            <label class="layui-form-label">推广图片：</label>
                            <div class="layui-input-block">
                                <input type="hidden" name="del" id="del2" value="">
                                <input type="hidden" id="hid2" value="{$info.pp_two_pic}">
                                <input type="hidden" name="pp_two_pic" id="photo2" value="{$info.pp_two_pic}">
                                <div id="uploader2" class="container-s">
                                    <div class="queueList">
                                        <div class="placeholder">
                                            <div id="filePicker2"></div>
                                            <p>或将图片拖到这里</p>
                                        </div>
                                    </div>
                                    <div class="statusBar" style="display:none;">
                                        <div class="layui-progress layui-progress-big active-s" lay-showpercent="true">
                                            <div class="layui-progress-bar layui-bg-blue" lay-percent="0%">
                                            </div>
                                            <span></span>
                                        </div>
                                        <div class="info"></div>
                                        <div class="btns">
                                            <div id="goPicker2" class="filePicker2"></div>
                                            <div class="uploadBtn">开始上传</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {if $agid != 10}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">排序值</label>
                            <div class="layui-input-block">
                                <input type="number" placeholder="值越大越靠前" value="{$info.pp_sort}" name="pp_sort" maxlength="11" class="layui-input" lay-verify="number" >
                            </div>
                        </div>
                        {/if}
                        <!--<div class="layui-form-item layui-col-md-offset1 layui-col-md8">-->
                            <!--<label class="layui-form-label">星星数量</label>-->
                            <!--<div class="layui-input-block">-->
                                <!--<input type="number" placeholder="0不显示星星，1-5显示1-5个星星" value="{$info.pp_star}" name="pp_star" maxlength="1" class="layui-input" lay-verify="number" >-->
                            <!--</div>-->
                            <!--<span style="color: red;padding-left: 10px;">填写0不显示星星，填写1-5对应显示1-5个星星</span>-->
                        <!--</div>-->
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录账号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_phone" value="{$info.pp_phone}" placeholder="登录账号(最好是手机号作为登录账号)" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录密码：</label>
                            <div class="layui-input-block">
                                <input type="text" name="pp_pass" value="{$info.pp_pass}" placeholder="登录密码" class="layui-input ">
                            </div>
                        </div>
                        <!--<div class="layui-form-item layui-col-md-offset1 layui-col-md8">-->
                            <!--<label class="layui-form-label">十大品牌</label>-->
                            <!--<div class="layui-input-block">-->
                                <!--{volist name='tens' id='t'}-->
                                <!--<input type="checkbox" {if in_array($t.ten_id,$open)}checked{/if} value="{$t.ten_id}" name="tens[]" title="{$t.ten_name}" />-->
                                <!--{/volist}-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md10">
                            <label class="layui-form-label">品牌介绍：</label>
                            <div class="layui-input-block" id="LAY_editor" lay-verify="editor">
                                <p>{$info.pp_desc}</p>
                            </div>
                        </div>
                        <input type="hidden" value="{$info.pp_id}" name="pp_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    var editor = wk.wang({elem:'#LAY_editor'});
    wk.uploadImg({size:5,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}",domain:""});
    var n2 = wk.uploads({num:2,type:'png,jpg,jpeg',attr:2,status:'update'})
    function imgDel2(e,obj,hid,del){
        wk.update_del(e,obj,hid,del,n2);
    }
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
//        form.verify({
//            editor:function(value,item){
//                if(editor.txt.html() == '<p><br></p>'){
//                    return '请填写内容';
//                }
//            }
//        });
        form.on('submit(component-form-element)', function (data) {
            data.field.pp_desc = editor.txt.html();
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('newEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
